using System;
using System.Collections.Generic;
using Betfair.Api.Types;
using Newtonsoft.Json;

namespace Betfair.Api
{
    public sealed class Runner
    {
        public Runner(long id, double handicap, RunnerStatus status, double adjustmentFactor, double lastPriceTraded,
            double matched, DateTime removalDate, StartingPrice startingPrice, ExchangePrice exchangePrice,
            IList<Order> orders, IList<Match> matches)
        {
            Id = id;
            Handicap = handicap;
            Status = status;
            AdjustmentFactor = adjustmentFactor;
            LastPriceTraded = lastPriceTraded;
            Matched = matched;
            RemovalDate = removalDate;
            StartingPrice = startingPrice;
            ExchangePrice = exchangePrice;
            Orders = orders;
            Matches = matches;
        }

        [JsonProperty("selectionId")]
        public long Id { get; private set; }

        [JsonProperty("handicap")]
        public double Handicap { get; private set; }

        [JsonProperty("status")]
        public RunnerStatus Status { get; private set; }

        [JsonProperty("adjustmentFactor")]
        public double AdjustmentFactor { get; private set; }

        [JsonProperty("lastPriceTraded")]
        public double LastPriceTraded { get; private set; }

        [JsonProperty("totalMatched")]
        public double Matched { get; private set; }

        [JsonProperty("removalDate")]
        public DateTime RemovalDate { get; private set; }

        [JsonProperty("sp")]
        public StartingPrice StartingPrice { get; private set; }

        [JsonProperty("ex")]
        public ExchangePrice ExchangePrice { get; private set; }

        [JsonProperty("orders")]
        public IList<Order> Orders { get; private set; }

        [JsonProperty("matches")]
        public IList<Match> Matches { get; private set; }
    }
}